home *** CD-ROM | disk | FTP | other *** search
/ Best of www.BestZips.com (Collector's Edition) / Best of WWW.BESTZIPS.COM Collector's Edition (JCSM Shareware) (JCS Marketing).ISO / other___ / ucalc32.zip / EXAMPLES.DOC < prev    next >
Text File  |  1996-11-21  |  7KB  |  251 lines

  1. Ultimate Calculator v3.2  (Unregistered)   [F1] for help
  2. Copyright (C) 1992-1996 by Daniel Corbier.  All rights reserved.
  3.  
  4. ucalc> ;*******************************************************************
  5. ucalc> ;  This text file is a sample session which demonstrates some of the
  6. ucalc> ;  features available in the Ultimate Calculator.  The sections are
  7. ucalc> ;  entitled:
  8. ucalc> ;
  9. ucalc> ;  1. General Calculations
  10. ucalc> ;  2. Physics for Thought
  11. ucalc> ;  3. HBO for Thought
  12. ucalc> ;  4. Are you converted yet?
  13. ucalc> ;  5. Let's use some FORCE
  14. ucalc> ;  6. How to pay
  15. ucalc> ;  7. Let's get a few FACTS straight
  16. ucalc> ;*******************************************************************
  17. ucalc> 
  18. ucalc> ; ***********************
  19. ucalc> ; 1. General Calculations
  20. ucalc> ; ***********************
  21. ucalc> 
  22. ucalc> 17*(5+8)^2
  23. Answer:  2873
  24.  
  25. ucalc> cos(pi)+8/pi + sinh(14)
  26. Answer:  601303.688561062095
  27.  
  28. ucalc> test(x) = x^pi + sin(x)   ; User defined function.
  29. ucalc> test(14)
  30. Answer:  3988.18506502600842
  31.  
  32. ucalc> sum(x*2+3^x,1..100)       ; Summation
  33. Answer:  7.73066281098016997E+47
  34.  
  35. ucalc> 
  36. ucalc> ; **********************
  37. ucalc> ; 2. Physics for Thought
  38. ucalc> ; **********************
  39. ucalc> 
  40. ucalc> mass   = 77.2     ; g
  41. MASS= 77.2
  42.  
  43. ucalc> Volume = 4.0      ; cm^3
  44. VOLUME= 4
  45.  
  46. ucalc> 
  47. ucalc> mass / Volume     ; Density
  48. Answer:  19.3
  49.  
  50. ucalc> 
  51. ucalc> mass = 13         ; Lets try a different mass
  52. MASS= 13
  53.  
  54. ucalc> 
  55. ucalc> mass / Volume     ; Now lets see the new density
  56. Answer:  3.25
  57.  
  58. ucalc> ; Quantum Mechanics
  59. ucalc> 
  60. ucalc> h = 6.63E-34      ; J s
  61. H= 6.63E-34
  62.  
  63. ucalc> m = 9.11E-31      ; kg
  64. M= 9.11E-31
  65.  
  66. ucalc> L = 2E-11         ; m
  67. L= .00000000002
  68.  
  69. ucalc> 
  70. ucalc> E(x) = (h^2/(8*m*L^2))*x^2  ; Allowed energies for a particle in a box.
  71. ucalc> 
  72. ucalc> E(1)
  73. Answer:  1.50785194840834248E-16
  74.  
  75. ucalc>              ; Oops, you meant L=2E-10, no problem use the Up arrow.
  76. ucalc> L = 2E-10
  77. L= .0000000002
  78.  
  79. ucalc> E(1)       ; You didn't have to retype the eq. !  Time saver, isn't it?
  80. Answer:  1.50785194840834248E-18
  81.  
  82. ucalc> E(5)
  83. Answer:  3.7696298710208562E-17
  84.  
  85. ucalc> 
  86. ucalc> ; ******************
  87. ucalc> ; 3. HBO for Thought
  88. ucalc> ; ******************
  89. ucalc> 
  90. ucalc> mode hbo        ; Results will be displayed in Hex, Binary, and Octal
  91.  
  92. ucalc> 
  93. ucalc> #h1E or #hAFF   ; ORing two hexadecimal numbers
  94. Decimal:  2815     Hex:  AFF     Binary:  101011111111     Octal:  5377
  95.  
  96. ucalc> 
  97. ucalc> $1E or $AFF     ; Same as above (shortcut notation for hex)
  98. Decimal:  2815     Hex:  AFF     Binary:  101011111111     Octal:  5377
  99.  
  100. ucalc> 
  101. ucalc> #b1010101 or #b111000 + 44/2
  102. Decimal:  95     Hex:  5F     Binary:  1011111     Octal:  137
  103.  
  104. ucalc> 
  105. ucalc> mode hbo        ; Toggle HBO mode back off
  106.  
  107. ucalc> 
  108. ucalc> ; *************************
  109. ucalc> ; 4. Are you converted yet?
  110. ucalc> ; *************************
  111. ucalc> 
  112. ucalc> feet_inches(x) = x * 12       ; You can put these and more in
  113. ucalc> meters_feet(x) = 3.281 * x    ; UCALC.DEF if you use them often.
  114. ucalc> celsius_fa(x)  = 9/5 * x + 32 ; Celsius to Fahrenheit.
  115. ucalc> 
  116. ucalc> celsius_fa(50)
  117. Answer:  122
  118.  
  119. ucalc> feet_inches(3)
  120. Answer:  36
  121.  
  122. ucalc> 
  123. ucalc> ; ***********************
  124. ucalc> ; 5. Let's use some FORCE
  125. ucalc> ; ***********************
  126. ucalc> 
  127. ucalc> ; FORCE = integral( pgh dA )
  128. ucalc> 
  129. ucalc> integ 3x^2*(x+7),4..7
  130. Answer:  3561.75
  131.  
  132. ucalc> integ 6.24*(3-x)*2*sqr(9-x^2),-3..3,1000 ; 1000 for higher precision
  133. Answer:  529.288609103337383
  134.  
  135. ucalc> 
  136. ucalc> ; *************
  137. ucalc> ; 6. How to pay
  138. ucalc> ; *************
  139. ucalc> 
  140. ucalc> ; You can do all your financial calculations with UCALC.
  141. ucalc> 
  142. ucalc> ; Lets take a loan to buy a nice house
  143. ucalc> 
  144. ucalc> payment(PV,i,n) = PV*i/(1-(1+i)^(-n))   ; Formula for monthly payments
  145. ucalc> 
  146. ucalc> PV = 175000           ; Loan balance
  147. PV= 175000
  148.  
  149. ucalc> i  = .01              ; Interest rate (1% monthly)
  150. I= .01
  151.  
  152. ucalc> n  = 240              ; Number of payments (20 years)
  153. N= 240
  154.  
  155. ucalc> 
  156. ucalc> payment(PV,i,n)
  157. Answer:  1926.90073374681746
  158.  
  159. ucalc> n  = 360              ; Maybe we can negotiate better terms
  160. N= 360
  161.  
  162. ucalc> 
  163. ucalc> payment(PV,i,n)
  164. Answer:  1800.07204461963275
  165.  
  166. ucalc> payment(215000,i,n)       ; Can we afford a bigger loan?
  167. Answer:  2211.51708338983452
  168.  
  169. ucalc> 
  170. ucalc> ; You want to become a millionaire by investing $50,000 and
  171. ucalc> ; earning 14% interest each year.  How many years will it take?
  172. ucalc> 
  173. ucalc> Term(FV,PV,i) = ln(FV/PV) / ln(1+i)
  174. ucalc> 
  175. ucalc> FV = 1000000          ; Future investment value
  176. FV= 1000000
  177.  
  178. ucalc> PV = 50000            ; Present investment value
  179. PV= 50000
  180.  
  181. ucalc> i  = .14              ; Annual interest
  182. I= .14
  183.  
  184. ucalc> 
  185. ucalc> Term(FV,PV,i)
  186. Answer:  22.8632526947680305
  187.  
  188. ucalc> ; It will take around 23 years
  189. ucalc> 
  190. ucalc> ; *********************************
  191. ucalc> ; 7. Let's get a few FACTS straight
  192. ucalc> ; *********************************
  193. ucalc> 
  194. ucalc> FACT(1500)*2
  195. Answer:  9.62399559355954972E+4114
  196.  
  197. ucalc> 1500!*2   ; version 2.+ now supports the factorial (!) symbol.
  198. Answer:  9.62399559355954972E+4114
  199.  
  200. ucalc> ; Wow, not even the US budget deficit is that big of a number.
  201. ucalc> ; Can your pocket calculator get a factorial that high?
  202. ucalc> 
  203. ucalc> solve( exp(x)+3*x = 15 )
  204. Answer:  2.14698767937181217
  205.  
  206. ucalc>             ; 'last' stores the answer to the previous operation.
  207. ucalc> exp(last)+3*last  ; You can use that concept for accuracy checks.
  208. Answer:  15
  209.  
  210. ucalc> solve( sin(x) = 1, 0..pi )
  211. Answer:  1.57079632679489662
  212.  
  213. ucalc> sumtable(x^2+2*x,0..10)
  214. Count         Value         Cumulative
  215.  0             0             0
  216.  1             3             3
  217.  2             8             11
  218.  3             15            26
  219.  4             24            50
  220.  5             35            85
  221.  6             48            133
  222.  7             63            196
  223.  8             80            276
  224.  9             99            375
  225.  10            120           495
  226. Answer:  495
  227.  
  228. ucalc> 
  229. ucalc> ; Compound functions can be defined by using relational operators.
  230. ucalc> 
  231. ucalc> ;           /  x^2+3,       x > 0
  232. ucalc> ; tst(x) = |   2,           x = 0
  233. ucalc> ;           \  x^2-3,       x < 0
  234. ucalc> 
  235. ucalc> tst(x) = (x^2+3)*(x>0)  +  (2)*(x=0)  +  (x^2-3)*(x<0)
  236. ucalc> tst(15)
  237. Answer:  228
  238.  
  239. ucalc> tst(-8)
  240. Answer:  61
  241.  
  242. ucalc> 3*tst(0)^2+pi
  243. Answer:  15.1415926535897932
  244.  
  245. ucalc> 
  246. ucalc> ; These are just some of the things you can do with UCALC.
  247. ucalc> 
  248. ucalc> ; Please remember to pay the registration fee.  This will allow me
  249. ucalc> ; to spend the necessary amount of time in order to add some of the
  250. ucalc> ; features that you would like to see in the next version.
  251. ucalc>